Release 10.1A: OpenEdge Development:
Progress 4GL Handbook
Cleaning up dynamic buffers
This example uses a handle to a static buffer to illustrate how to use buffer attributes and methods, because the table name is known. You could also create a dynamic buffer for the table like this:
Given that the table name is known and that it is, therefore, a literal in the
CREATE BUFFERstatement, there is no particular advantage to doing this. TheCREATE BUFFERstatement is better used when the buffer name is variable.When you create dynamic buffers, rather than just using handles to static buffers, you need to delete them when you’re done using them, just as with other objects. You use the same
DELETE OBJECTstatement to do this.Often you will want to delete dynamic buffers along with the dynamic query that uses them. You can use the
GET-BUFFER-HANDLEmethod to determine what buffers to delete when you have finished with a dynamic query with dynamic buffers, as in this example, saved ash-cleanup.p:
Note that you cannot delete the buffers in the loop where the code uses the
GET-BUFFER-HANDLEmethod at the end of the procedure because deleting the buffers would un-prepare the query and cause it to lose the list of buffers before you had retrieved them all. Thus, you need to build a comma-separated list of buffer handles and walk through the list afterwards to delete the buffers, and then delete the query.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |